package cw.fb.patch;

import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;

import c4j.cvs.patch.BeyondCompareSourcePatcher;
import c4j.cvs.patch.Patcher;
import c4j.file.FileUtils;

public class FB_Openfunction_BeyondCompare_xml_patch {

	public static void main(String[] args) throws Exception {
		Map<String, String> parameters = new HashMap<String, String>();
		parameters.put(Patcher.JAVA_COMPILE_DIR, "D:\\Project Code\\FB_OpenFunction_2008\\project-code\\build\\classes\\");

		parameters.put(Patcher.JAVA_DIR_1, "C:\\Program Files\\Apache Software Foundation\\Tomcat 5.5\\webapps\\openfunction\\WEB-INF\\classes\\");
		parameters.put(Patcher.CONF_DIR_1, "C:\\Program Files\\Apache Software Foundation\\Tomcat 5.5\\webapps\\openfunction\\WEB-INF\\classes\\");
		parameters.put(Patcher.PROP_DIR_1, "C:\\Program Files\\Apache Software Foundation\\Tomcat 5.5\\webapps\\openfunction\\WEB-INF\\classes\\");

		parameters.put(Patcher.JSP_DIR, "C:\\Program Files\\Apache Software Foundation\\Tomcat 5.5\\webapps\\openfunction\\");

		parameters.put(Patcher.JAVA_DIR_2, "C:\\swfund_daemon\\lib\\openfun_daemon.jar\\");
		parameters.put(Patcher.CONF_DIR_2, "C:\\swfund_daemon\\conf\\");
		parameters.put(Patcher.PROP_DIR_2, "C:\\swfund_daemon\\lib\\openfun_daemon.jar\\");

		patch20120612(parameters);
	}

	private static void patch20120612(Map<String, String> parameters) throws Exception {
		HashSet<String> filterFileSet = new HashSet<String>();
		filterFileSet.add("build.xml");
		filterFileSet.add("build.properties");
		filterFileSet.add("log4j.properties");
		filterFileSet.add("applicationContext-db.xml");
		filterFileSet.add("dataAccessContext-mssql.xml");
		filterFileSet.add("applicationContext-jms.xml");
		filterFileSet.add("applicationContext-ffio.xml");

		BeyondCompareSourcePatcher.patchByBeyondCompareXml("c:/fb_openfunction_report.xml", FileUtils.getTodayStoreDir("D:\\FB_OPENFUNC_PATCH"), parameters, filterFileSet);

	}

}
